package main

import (
	"fmt"
	"net/http"
)

func formHandler(w http.ResponseWriter, r *http.Request) {
	http.ServeFile(w, r, "form.html")
}

func submitHandler(w http.ResponseWriter, r *http.Request) {
	r.ParseForm()
	name := r.Form.Get("name")
	fmt.Fprintf(w, "提交的姓名为：%s", name)
}

func main() {
	http.HandleFunc("/", formHandler)
	http.HandleFunc("/submit", submitHandler)

	http.ListenAndServe(":8080", nil)
}
